import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import layout from "@/layout/index.vue"
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home', 
    meta:{
      name:"首页",
      icon:"el-icon-delete"
    },
    component: layout,
    redirect: "/homeManage/home/homeA"
  },
  {
    path: '/login',
    name: 'login', 
    meta:{
      name:"登录",
      icon:"el-icon-delete"
    },
    component:() => import(/* webpackChunkName: "about" */ '../views/login/index.vue')
  },
  {
    path: '/homeManage',
    name: 'home', 
    meta:{
      name:"首页管理",
      icon:"el-icon-delete"
    },
    component: layout,
    children:[
      {
        path: 'home',
        name: 'homeManagehome', 
        meta:{
          name:"首页",
          icon:"el-icon-delete"
        },
        component:() => import(/* webpackChunkName: "about" */ '../views/home/index.vue'),
        children:[
          {
            path: 'homeA',
            name: 'homeManagehomeA', 
            meta:{
              name:"首页a",
              icon:"el-icon-delete"
            },
            component:() => import(/* webpackChunkName: "about" */ '../views/home/homeA/index.vue'),
          },{
            path: 'homeB',
            name: 'homeManagehomeB', 
            meta:{
              name:"首页b",
              icon:"el-icon-delete"
            },
            component:() => import(/* webpackChunkName: "about" */ '../views/home/homeB/index.vue'),
          },
        ]
      },
    ]
  },
  {
    path: '/aboutManage',
    name: 'about', 
    meta:{
      name:"about管理",
      icon:"el-icon-delete"
    },
    component: layout,
    children:[
      {
        path: 'about',
        name: 'aboutManageabout', 
        meta:{
          name:"about",
          icon:"el-icon-delete"
        },
        component:() => import(/* webpackChunkName: "about" */ '../views/about/index.vue'),
       
      },
    ]
  },
  
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
